var entityCollection = require('../../../Base/server/controllers/EntityCollection'),
	stationWorkController = require('../../../Initialize/server/controllers/StationWork.server.controller');

exports.findByTerminalID = function(terminalID, completeFun){
	var entity = entityCollection.getEntity("StationTerminal");
	entity.findOne({Terminal: terminalID}, [{path: 'Terminal'}, {path: 'WorkLocation'}], function(err, record){
		if(err){
			var newErr = new Error();
            newErr.leval = 9;
            newErr.title = '查询工位终端交叉表错误';
            newErr.message = '请检查查询参数！';
            completeFun(newErr);
		}
		else{
			completeFun(null, record);
		}
	});
};
